package pl.edu.agh.anomalyids.lerad.aspect.implementation;

import pl.edu.agh.anomalyids.lerad.aspect.AbstractAspect;
import pl.edu.agh.anomalyids.lerad.aspect.enums.AspectType;
import pl.edu.agh.anomalyids.lerad.aspect.enums.Match;
import pl.edu.agh.anomalyids.network.Packet;

/**
 * 
 * Kontener na port lub zbior portow.
 * 
 * @author Andrzej
 * 
 */
public class PortAspect extends AbstractAspect<Integer> {

	private static final long serialVersionUID = 8995844327732138091L;

	/**
	 * Konstruktor. Nalezy podac port, jaki chcemy akceptowac poprzez
	 * validate().
	 * 
	 * @param port
	 *            wartosc portu
	 * @param type
	 *            typ cechy
	 */
	public PortAspect(Integer port, AspectType type) {
		super(type);
		this.values.add(port);
	}

	@Override
	public String toString() {
		return String.valueOf(getData());
	}

	@Override
	public Match packetMatchesAspect(Packet packet) {
		return Match.DIFFER;
	}

}
